#ifndef DATACENTER_H
#define DATACENTER_H

#include <QObject>
#include "common.h"
#include "icomponent.h"

class DataCenter : public QObject
{
    Q_OBJECT
public:
    static DataCenter *instance();
    ~DataCenter();

    void addComponent(ComponentPtr);
    void removeComponent(ComponentPtr);
    void clearComponent();

    void start(const QString *arg = Q_NULLPTR);
    void stop();

signals:
    void setParameter(const VdsParameterPtr parameter);
    void dataReady(const VdsMeasureDataPtr data);
    void measureError(VdsError vdsError);
    void dataFileReady(const QString &path);

private:
    QList<ComponentPtr> m_components;
    explicit DataCenter(QObject *parent = Q_NULLPTR);
    Q_DISABLE_COPY(DataCenter)
};

#endif // DATACENTER_H
